package de.jkoslows.decisions.entity;

import java.util.Collection;
import java.util.HashSet;

import static de.jkoslows.util.control.Util.*;

public class Item {

	Collection<Parameter> parameters;
	private int id;
	private String name  = "no name";
	private String description = "no description";

	public Item(int i){
		this.id = assertNotNull(i, Integer.class);
		this.parameters = new HashSet<Parameter>();
	}
	
	public Item(int i, String name, String description) {
		this(i);
		this.name = assertNotNull(name, String.class);
		this.description = assertNotNull(description, String.class);
	}

	public void addParameter(Parameter parameter) {
		parameters.add(assertNotNull(parameter, Parameter.class));
	}

	public void addChild(Item item) {
		
	}

	public boolean hasParameter(Parameter parameter) {
		for (Parameter itemParameter : parameters) {
			if(itemParameter.sameType(parameter))
				return true;
		}
		return false;
		
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	

}
